
UPDATE FLW_LIC_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.68.121 (192.168.68.121)', LOCKGRANTED = SYSTIMESTAMP WHERE ID = 1 AND LOCKED = 0;

UPDATE FLW_LIC_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE FLW_CTRL_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.68.121 (192.168.68.121)', LOCKGRANTED = SYSTIMESTAMP WHERE ID = 1 AND LOCKED = 0;

CREATE TABLE FLW_CTRL_AUTH_CLUSTER_MAPPING (ID_ VARCHAR2(255) NOT NULL, AUTHORITY_ VARCHAR2(255), CLUSTER_CONFIG_ID_ VARCHAR2(255), CONSTRAINT PK_FLW_CTRL_AUTH_CLUSTER_MAPPI PRIMARY KEY (ID_));

ALTER TABLE FLW_CTRL_AUTH_CLUSTER_MAPPING ADD CONSTRAINT FLW_CTRL_FK_CLUSTER_CONFIG FOREIGN KEY (CLUSTER_CONFIG_ID_) REFERENCES FLW_CTRL_CLUSTER_CONFIG (ID_) ON DELETE CASCADE;

CREATE INDEX FLW_CTRL_IDX_AUTHORITY_ ON FLW_CTRL_AUTH_CLUSTER_MAPPING(AUTHORITY_);

INSERT INTO FLW_CTRL_AUTH_CLUSTER_MAPPING(ID_, AUTHORITY_, CLUSTER_CONFIG_ID_)
            SELECT regexp_replace(lower(SYS_GUID()), '(.{8})(.{4})(.{4})(.{4})(.{12})', '\1-\2-\3-\4-\5'), 'access-control', clusterConf.ID_
            FROM FLW_CTRL_CLUSTER_CONFIG clusterConf;

INSERT INTO FLW_CTRL_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('10', 'flowable', 'META-INF/liquibase/flowable-control-db-changelog.xml', SYSTIMESTAMP, 10, '8:64d97ec2bb66b52832ed212450765f64', 'createTable tableName=FLW_CTRL_AUTH_CLUSTER_MAPPING; addForeignKeyConstraint baseTableName=FLW_CTRL_AUTH_CLUSTER_MAPPING, constraintName=FLW_CTRL_FK_CLUSTER_CONFIG, referencedTableName=FLW_CTRL_CLUSTER_CONFIG; createIndex indexName=FLW_CTRL_IDX_AU...', '', 'EXECUTED', NULL, NULL, '4.11.0', '8715003557');

DROP INDEX FLW_DE_IDX_PRIVILEGE_GROUP;

DROP INDEX FLW_DE_IDX_PRIVILEGE_ROLE;

CREATE INDEX FLW_CTRL_IDX_PRIVILEGE_GROUP ON FLW_CTRL_ROLE_USER_MAPPING(GROUP_ID_);

CREATE INDEX FLW_CTRL_IDX_PRIVILEGE_ROLE ON FLW_CTRL_ROLE_USER_MAPPING(ROLE_ID_);

INSERT INTO FLW_CTRL_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('11', 'flowable', 'META-INF/liquibase/flowable-control-db-changelog.xml', SYSTIMESTAMP, 11, '8:5a6e6c54ddbc6fb4cec9beefb96e7b43', 'dropIndex indexName=FLW_DE_IDX_PRIVILEGE_GROUP, tableName=FLW_CTRL_ROLE_USER_MAPPING; dropIndex indexName=FLW_DE_IDX_PRIVILEGE_ROLE, tableName=FLW_CTRL_ROLE_USER_MAPPING; createIndex indexName=FLW_CTRL_IDX_PRIVILEGE_GROUP, tableName=FLW_CTRL_ROLE_...', '', 'EXECUTED', NULL, NULL, '4.11.0', '8715003557');

UPDATE FLW_CTRL_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;

